package com.greendragon.service.backend; 

import java.util.List;

import com.greendragon.persistence.enmu.FetchOrderType;
import com.greendragon.persistence.enmu.LockType;


/** 
 * @author wulibin, exceptsky@gmail.com, 2011-10-26 下午05:01:21
 * 
 */
public interface IBaseBackendService<T> {
	
	public void add(T entity);
	
	public void delete(long id);
	
	public void deleteBatch(long ids[]);
	
	public T get(long id);
		
	public long getCountByCondition(T expEntity);
	
	public long getTotalCount(LockType lockType);
	
	/*page 从第0页开始*/
	public List<T> getPage(int page, LockType lockType, FetchOrderType orderType);
	
	public List<T> getAll(FetchOrderType orderType);
	
	public List<T> getByCondition(T expEntity, int page, FetchOrderType orderType);
	
	public List<T> getUnlock(int page);
	
	public List<T> getLock(int page);
	
	public int getPageLength();
	
	public void setPageLength(int length);
	
	public void update(T entry);
}
 